/**
  **************************************************************************
  * @file     main.c
  * @brief    main program
  **************************************************************************
  * OLED Demo 基于硬件IIC轮询模式
  *
  **************************************************************************
  *
  */
#include "at32f413_clock.h"
#include <stdio.h>
#include "state_led.h"
#include "iic_oled.h"
#include "use_printf.h"
//#include "at32f413_i2c.h"

/* 全局变量 */
uint32_t systick_count = 0;
float tmp = 0.00f;

/**
  * @brief  main function.
  * @param  none
  * @retval none
  */
int main(void)
{
    system_clock_config();
    state_led_init();
    SysTick_Config(SystemCoreClock/1000);
    use_printf_config();
    oled_init();

	printf("oled_init done!\n");
	OLED_ColorTurn(0);
	OLED_DisplayTurn(0);
	OLED_Clear(0);

	OLED_DrawCircle(64,16+24,22);
	//OLED_ShowString(0,0,(uint8_t*)"xiaotupo.com", 16, 1);
	OLED_ShowChinese(0,0,11,16,1);
	OLED_ShowChinese(17,0,12,16,1);
	OLED_ShowChinese(33,0,13,16,1);
	OLED_Refresh();

    while(1)
    {
		OLED_ShowFNum(0, 17, tmp, 24, 1);
		OLED_Refresh();
		if(systick_count > 500)
		{
			tmp += 0.2f;
			systick_count = 0;
		}
		printf("while(1)\n");
		
    }
}
